home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / util / moni / Scout-src.lha / netinclude / rpcsvc / sm_inter.x < prev    next >
Text File  |  2002-09-16  |  2KB  |  89 lines

  1. /* @(#)sm_inter.x    2.2 88/08/01 4.0 RPCSRC */
  2. /* @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro */
  3.  
  4.  
  5. /*
  6.  * Status monitor protocol specification
  7.  * Copyright (C) 1986 Sun Microsystems, Inc.
  8.  *
  9.  */
  10.  
  11.  
  12. program SM_PROG { 
  13.     version SM_VERS  {
  14.         /* res_stat = stat_succ if status monitor agrees to monitor */
  15.         /* res_stat = stat_fail if status monitor cannot monitor */
  16.         /* if res_stat == stat_succ, state = state number of site sm_name */
  17.         struct sm_stat_res             SM_STAT(struct sm_name) = 1;
  18.  
  19.         /* res_stat = stat_succ if status monitor agrees to monitor */
  20.         /* res_stat = stat_fail if status monitor cannot monitor */
  21.         /* stat consists of state number of local site */
  22.         struct sm_stat_res             SM_MON(struct mon) = 2;
  23.  
  24.         /* stat consists of state number of local site */
  25.         struct sm_stat                 SM_UNMON(struct mon_id) = 3;
  26.  
  27.         /* stat consists of state number of local site */
  28.         struct sm_stat                 SM_UNMON_ALL(struct my_id) = 4;
  29.  
  30.         void                     SM_SIMU_CRASH(void) = 5;
  31.  
  32.     } = 1;
  33. } = 100024;
  34.  
  35. const    SM_MAXSTRLEN = 1024;
  36.  
  37. struct sm_name {
  38.     string mon_name<SM_MAXSTRLEN>;
  39. };
  40.  
  41. struct my_id {
  42.     string     my_name<SM_MAXSTRLEN>;        /* name of the site iniates the monitoring request*/
  43.     int    my_prog;            /* rpc program # of the requesting process */
  44.     int    my_vers;            /* rpc version # of the requesting process */
  45.     int    my_proc;            /* rpc procedure # of the requesting process */
  46. };
  47.  
  48. struct mon_id {
  49.     string    mon_name<SM_MAXSTRLEN>;        /* name of the site to be monitored */
  50.     struct my_id my_id;
  51. };
  52.  
  53.  
  54. struct mon{
  55.     struct mon_id mon_id;
  56.     opaque priv[16];         /* private information to store at monitor for requesting process */
  57. };
  58.  
  59.  
  60. /*
  61.  * state # of status monitor monitonically increases each time
  62.  * status of the site changes:
  63.  * an even number (>= 0) indicates the site is down and
  64.  * an odd number (> 0) indicates the site is up;
  65.  */
  66. struct sm_stat {
  67.     int state;        /* state # of status monitor */
  68. };
  69.  
  70. enum res {
  71.     stat_succ = 0,        /* status monitor agrees to monitor */
  72.     stat_fail = 1        /* status monitor cannot monitor */
  73. };
  74.  
  75. struct sm_stat_res {
  76.     res res_stat;
  77.     int state;
  78. };
  79.  
  80. /* 
  81.  * structure of the status message sent back by the status monitor
  82.  * when monitor site status changes
  83.  */
  84. struct status {
  85.     string mon_name<SM_MAXSTRLEN>;
  86.     int state;
  87.     opaque priv[16];        /* stored private information */
  88. };
  89.